package field

import "gitee.com/yanwc/net/utils"

type (
	Course    uint16
	CourseRaw [2]byte // 方向(相对正北方向) 单位: °
)

func (c Course) Raw() (out CourseRaw) {
	copy(out[:], utils.NumberToBytesWithBigEndian(c))
	return
}

func (c CourseRaw) Type() Course {
	return utils.BytesToNumber[Course](c[:])
}

func (c CourseRaw) Slice() []byte {
	return c[:]
}
